1. Field of the Invention
The methods, systems, and devices described generally relate to a multitask processor and in particular a method for debugging a multitask program executed by a microprocessor- or microcontroller-type processor.
2. Description of the Related Art
Certain processors comprise a test interface enabling an external emulator to be connected to the processing unit of the processor and to send it instructions to be executed. The processor comprises a debugging mode in which the test interface is active and supplies the processing unit with instructions received from the external emulator. The instructions supplied to the processor by the test interface then replace the instructions coming from the program memory.
There are several types of architectures of multitask processor. In architectures of a first type, the processor comprises several processing units (CPU) that share common resources, such as the memory, to each execute one task. In architectures of a second type, the processor comprises a single processing unit which executes several tasks by switching from one task to another. The switch from a first task to a second task is done by interrupting the first task, by saving the registers of the processor used by the first task, then by possibly restoring the registers used by the second task, and finally, by activating the execution of the second task. The switch from one task to another can occur at any time during the execution of the current task, particularly further to an internal or external event. In particular, an internal or external event may trigger the execution of a higher-priority task while another task is in debugging mode. The higher-priority task may access the same resources as the task in debugging mode.
The execution of a multitask program by a processor of the first or of the second type can therefore be very complex. This is why, in principle, classic debugging methods do not authorize the interruption of a debugging task in progress by a higher-priority task, and the higher-priority task to be itself put into debugging mode. A multitask program is therefore generally debugged task by task, starting with the highest-priority tasks. Therefore, the debugging of a multitask program particularly does not enable conflicts between tasks to be detected, such as conflicts of access to resources shared by the tasks.